package com.aos.erp.manager.service.sys.impl;

import com.aos.erp.common.bean.ResultBean;
import com.aos.erp.common.exception.BizException;
import com.aos.erp.manager.mapper.sys.RoleMapper;
import com.aos.erp.manager.model.sys.Role;
import com.aos.erp.manager.remote.model.SynRole;
import com.aos.erp.manager.remote.sys.SynRoleService;
import com.aos.erp.manager.service.sys.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: erp
 * @description: 机构角色
 * @author: tanzhiyu
 * @create: 2018-11-23 10:17
 **/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
    @Resource
    private RoleMapper roleMapper;
    @Resource
    SynRoleService synRoleService;

    @Override
    public List<Role> findByName(String name) throws BizException {
        ResultBean synUser = synRoleService.queryPageBy("aos-app", "","A00001", 1, 10);
        if (ResultBean.CODE_FAIL == synUser.getCode()) {
            throw new BizException(synUser.getErrMsg());
        }
        return null;
    }

    @Override
    public int updateObject(Role role) {
        return 0;
    }

    @Override
    public Long insertObject(Role role) {
        return null;
    }

    public void addObject(SynRole synRole){}

}
